/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package rc;

import tal.remotecanvas.CanvasPacket.ALIGN;
import tal.remotecanvas.UIComponent;
import tal.remotecanvas.UILabel;

/**
 *
 * @author Tal Eisenberg
 */
public class Label extends UI {
    public Label() {
        component = new UILabel();
    }

    public void valueChanged(UIComponent source, Object value) {
    }

    public void setOpaque(Boolean o) { ((UILabel)component).setOpaque(o); }
    public boolean getOpaque() { return ((UILabel)component).isOpaque(); }

    public void setVertAlignment(String vertical) {
        ALIGN v = ALIGN.alignByName("vert" + vertical.substring(0, 1).toUpperCase() + vertical.substring(1));
        ALIGN h = ((UILabel)component).getHorizontalAlignment();
        ((UILabel)component).setAlignment(h, v);
    } public String getVertAlignment() {
        String vert = ((UILabel)component).getVerticalAlignment().name();
        vert = vert.substring(4, 5).toLowerCase() + vert.substring(5);
        return vert;
    }

    public void setHorAlignment(String horizontal) {
        ALIGN v = ((UILabel)component).getVerticalAlignment();
        ALIGN h = ALIGN.alignByName("hor" + horizontal.substring(0, 1).toUpperCase() + horizontal.substring(1));

        ((UILabel)component).setAlignment(h, v);
    } public String getHorAlignment() {
        String hor = ((UILabel)component).getHorizontalAlignment().name();
        hor = hor.substring(3, 4).toLowerCase() + hor.substring(4);
        return hor;
    }

}
